<%--
  Created by IntelliJ IDEA.
  User: YanHilin
  Date: 2020/4/29
  Time: 19:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商家注册</title>
    <base href="http://localhost:8080/onlineflower/">
    <link rel="stylesheet" type="text/css" href="static/css/form.css">
    <%@include file="/page/comment/head.jsp"%>
    <%@include file="/page/comment/code_img.jsp"%>
    <script src="static/js/jquery-3.4.1.js"></script>
    <script>
        $(function () {
            $("#enterpriseid").blur(function () {
                var enterpriseid=this.value;
                $.getJSON("http://localhost:8080/onlineflower/enterpriseServlet","action=ajaxExistsEnterpriseid&enterpriseid="+enterpriseid,function (data) {
                    if(data.existsEnterpriseid){
                        $("#errormesg").text("该企业编号"+enterpriseid+"已经存在！");
                    }else{
                        $("#errormesg").text("企业编号"+enterpriseid+"可用！");
                    }
                })
            });
        })
    </script>
</head>
<body>
<%@include file="/page/comment/head_nav.jsp"%>
<div id="content">
    <form action="enterpriseServlet" method="post">
        <input type="hidden" name="action" value="register">
        <div class="form-group">
            <label class="glyphicon glyphicon-user">编号</label>  <span id="errormesg">${requestScope.mess}</span>
            <input id="enterpriseid" class="form-control input-lg"  type="text" name="enterpriseid" placeholder="请输入编号">
        </div>
        <div class="form-group">
            <svg class="bi bi-gear-wide" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                <path fill-rule="evenodd" d="M8.932.727c-.243-.97-1.62-.97-1.864 0l-.071.286a.96.96 0 0 1-1.622.434l-.205-.211c-.695-.719-1.888-.03-1.613.931l.08.284a.96.96 0 0 1-1.186 1.187l-.284-.081c-.96-.275-1.65.918-.931 1.613l.211.205a.96.96 0 0 1-.434 1.622l-.286.071c-.97.243-.97 1.62 0 1.864l.286.071a.96.96 0 0 1 .434 1.622l-.211.205c-.719.695-.03 1.888.931 1.613l.284-.08a.96.96 0 0 1 1.187 1.187l-.081.283c-.275.96.918 1.65 1.613.931l.205-.211a.96.96 0 0 1 1.622.434l.071.286c.243.97 1.62.97 1.864 0l.071-.286a.96.96 0 0 1 1.622-.434l.205.211c.695.719 1.888.03 1.613-.931l-.08-.284a.96.96 0 0 1 1.187-1.187l.283.081c.96.275 1.65-.918.931-1.613l-.211-.205a.96.96 0 0 1 .434-1.622l.286-.071c.97-.243.97-1.62 0-1.864l-.286-.071a.96.96 0 0 1-.434-1.622l.211-.205c.719-.695.03-1.888-.931-1.613l-.284.08a.96.96 0 0 1-1.187-1.186l.081-.284c.275-.96-.918-1.65-1.613-.931l-.205.211a.96.96 0 0 1-1.622-.434L8.932.727zM8 12.997a4.998 4.998 0 1 0 0-9.995 4.998 4.998 0 0 0 0 9.996z" clip-rule="evenodd"/>
            </svg> <label for="exampleInputEmail2">商铺名称</label>
            <input type="text" name="enterprise_name" class="form-control input-lg" id="exampleInputEmail4" placeholder="商铺名称">
        </div>
        <div class="form-group">
            <svg class="bi bi-people-circle" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                <path d="M13.468 12.37C12.758 11.226 11.195 10 8 10s-4.757 1.225-5.468 2.37A6.987 6.987 0 0 0 8 15a6.987 6.987 0 0 0 5.468-2.63z"/>
                <path fill-rule="evenodd" d="M8 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" clip-rule="evenodd"/>
                <path fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z" clip-rule="evenodd"/>
            </svg>  <label for="exampleInputEmail2">relname</label>
            <input type="text" name="relname" class="form-control input-lg" id="exampleInputEmail2" placeholder="relname">
        </div>

        <div class="form-group">
            <span class="glyphicon glyphicon-earphone"></span>  <label for="exampleInputEmail3">telephone</label>
            <input type="text" name="telephone" class="form-control input-lg" id="exampleInputEmail3" placeholder="telephone">
        </div>
        <div class="form-group">
            <label class="glyphicon glyphicon-edit">密码</label>
            <input type="password"  class="form-control input-lg" name="password" placeholder="请输入密码">
        </div>
        <div class="form-group">
            <label class="glyphicon glyphicon-edit">再次输入密码</label>
            <input type="password" class="form-control input-lg" name="again_password" placeholder="请再次输入密码">
        </div>
        <div class="form-group">
            <label class="glyphicon glyphicon-check">验证码</label>
            <div class="row">
                <div class="col-7">
                    <input id="input_code" type="text" class="form-control input-lg" name="code" placeholder="请输入验证码">
                </div>
                <div class="col-5">
                    <img id="code_img" src="KaptchaServlet.jpg" alt="">

                </div>
            </div>
        </div>
        <br/>
        <button type="submit" class="btn btn-secondary btn-lg btn-block">register</button>
    </form>
</div>
</body>
</html>
